home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9664 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: bitfields, how big can their elements be?
  5. Date: 12 Mar 1996 09:28:45 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4i4c8dINNsde@keats.ugrad.cs.ubc.ca>
  8. References: <4i2lab$ili@hobbes.cc.uga.edu> <TANMOY.96Mar12075107@qcd.lanl.gov>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <TANMOY.96Mar12075107@qcd.lanl.gov>,
  12. Tanmoy Bhattacharya <tanmoy@qcd.lanl.gov> wrote:
  13.  >In article <4i2lab$ili@hobbes.cc.uga.edu>
  14.  >greear@pollux.cs.uga.edu (Ben Greear) writes:
  15.  >
  16.  >BG: 
  17.  >BG: Ok, i have a question on bitfields....  How big can their members be,
  18.  >
  19.  >Eacm member is valid if its width is smaller than or equal to the
  20.  >number of bits in an ordinary object of the corresponding type,
  21.  >i.e. the number of bits in an int. This number may vary from
  22.  >implementation to implementation, but is guaranteed to be at least 16. 
  23.  
  24. With GCC I tried making bitfields "long" and "short". This is an odd locution;
  25. the compiler will actually prevent a "short" field from being more than 16
  26. bits, but long can be 32. It's strange that the GNU compiler allows these
  27. modifiers for bitfields! I'm going to have to look this up in the standard the
  28. first chance I get.
  29. -- 
  30.  
  31.